# -*- coding: utf-8 -*-

import os.path

filePath =  "C:\\test\\SUMMARY.md"
f = open(filePath, 'a', encoding='utf-8')

f.write( '# Summary\n')
f.write( '\n')
f.write( '\n')
f.write( '* [项目介绍](README.md)')
f.write( '\n')
f.write( '* [权谋网](chinese/权谋网/权谋网.md)')
f.write( '\n')


rootdir ="C:\\test\\权谋网\\"

list = os.listdir(rootdir)
for file in list:
    fileBaseName =  os.path.basename( file)
    array = fileBaseName.split(".")
    f.write( '    * [')
    f.write( array[0])
    f.write('](chinese/权谋网/')
    f.write(fileBaseName)
    f.write( ')\n')
